package com.rookie.im.user.service.adapter;

import cn.hutool.core.bean.BeanUtil;
import com.rookie.im.common.enums.YON;
import com.rookie.im.user.domain.entity.User;
import com.rookie.im.user.dto.UserEntity;

import java.util.UUID;

public class UserAdapter {
    public static User importUser(UserEntity userEntity) {
        User user = new User();
        BeanUtil.copyProperties(userEntity, user);
        user.setUserId(UUID.randomUUID().toString());
        user.setIsActive(YON.YES.getCode());
        user.setIsSlient(YON.NO.getCode());
        return user;
    }
}
